package com.itheima.service.impl;

import com.itheima.mapper.EmpMapper;
import com.itheima.pojo.Emp;
import com.itheima.pojo.PageResult;
import com.itheima.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;


@Service
public class EmpServiceimp<EmpMapper> implements EmpService {
    @Autowired
   private com.itheima.mapper.EmpMapper empMapper;
    @Override
    public PageResult<Emp> page(Integer page, Integer pageSize, String name, Integer gender, LocalDate begin, LocalDate end) {
pageHelp
        long total = empMapper.count();
            Integer start = (page-1) * pageSize;

            List<Emp> rows = empMapper.list(start, pageSize,name,gender,begin,end);
            Page<Emp> p = (Page<Emp>)  emplist;
            return new PageResult<Emp>(total,rows) ;
        }

    }





